Optimal. Leaf size=353 \[ \frac {2 a (a-b) \sqrt {a+b} \cot (c+d x) E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{3 d}+\frac {2 \sqrt {a+b} \left (3 a^2+a b-b^2\right ) \cot (c+d x) F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{3 d}-\frac {2 a^2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{d}-\frac {2 b^2 \sqrt {a+b \sec (c+d x)} \tan (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 353, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {4127, 4003,
4143, 4006, 3869, 3917, 4089} \begin {gather*} \frac {2 \sqrt {a+b} \left (3 a^2+a b-b^2\right ) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} F\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{3 d}-\frac {2 a^2 \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \Pi \left (\frac {a+b}{a};\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d}+\frac {2 a (a-b) \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\text {ArcSin}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{3 d}-\frac {2 b^2 \tan (c+d x) \sqrt {a+b \sec (c+d x)}}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3869
Rule 3917
Rule 4003
Rule 4006
Rule 4089
Rule 4127
Rule 4143
Rubi steps
\begin {align*} \int \sqrt {a+b \sec (c+d x)} \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx &=-\int (-a+b \sec (c+d x)) (a+b \sec (c+d x))^{3/2} \, dx\\ &=-\frac {2 b^2 \sqrt {a+b \sec (c+d x)} \tan (c+d x)}{3 d}-\frac {2}{3} \int \frac {-\frac {3 a^3}{2}-\frac {1}{2} b \left (3 a^2-b^2\right ) \sec (c+d x)+\frac {1}{2} a b^2 \sec ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=-\frac {2 b^2 \sqrt {a+b \sec (c+d x)} \tan (c+d x)}{3 d}-\frac {2}{3} \int \frac {-\frac {3 a^3}{2}+\left (-\frac {a b^2}{2}-\frac {1}{2} b \left (3 a^2-b^2\right )\right ) \sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx-\frac {1}{3} \left (a b^2\right ) \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=\frac {2 a (a-b) \sqrt {a+b} \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{3 d}-\frac {2 b^2 \sqrt {a+b \sec (c+d x)} \tan (c+d x)}{3 d}+a^3 \int \frac {1}{\sqrt {a+b \sec (c+d x)}} \, dx+\frac {1}{3} \left (b \left (3 a^2+a b-b^2\right )\right ) \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=\frac {2 a (a-b) \sqrt {a+b} \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{3 d}+\frac {2 \sqrt {a+b} \left (3 a^2+a b-b^2\right ) \cot (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{3 d}-\frac {2 a^2 \sqrt {a+b} \cot (c+d x) \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{d}-\frac {2 b^2 \sqrt {a+b \sec (c+d x)} \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 12.74, size = 598, normalized size = 1.69 \begin {gather*} -\frac {4 \cos ^2\left (\frac {1}{2} (c+d x)\right ) \cos ^2(c+d x) \sqrt {a+b \sec (c+d x)} \left (a^2-b^2 \sec ^2(c+d x)\right ) \left (2 i a (a-b) b \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} E\left (i \sinh ^{-1}\left (\sqrt {\frac {-a+b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right )-2 i \left (3 a^3-3 a^2 b-a b^2+b^3\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} F\left (i \sinh ^{-1}\left (\sqrt {\frac {-a+b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right )+12 i a^3 \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \Pi \left (-\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {-a+b}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right )-a b \sqrt {\frac {-a+b}{a+b}} \cos (c+d x) (b+a \cos (c+d x)) \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )\right )}{3 \sqrt {\frac {-a+b}{a+b}} d (b+a \cos (c+d x)) \left (a^2-2 b^2+a^2 \cos (2 c+2 d x)\right )}+\frac {\cos ^2(c+d x) \sqrt {a+b \sec (c+d x)} \left (a^2-b^2 \sec ^2(c+d x)\right ) \left (-\frac {4}{3} a b \sin (c+d x)-\frac {4}{3} b^2 \tan (c+d x)\right )}{d \left (a^2-2 b^2+a^2 \cos (2 c+2 d x)\right )} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1507\) vs.
\(2(318)=636\).
time = 0.23, size = 1508, normalized size = 4.27
method | result | size |
default | \(\text {Expression too large to display}\) | \(1508\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a - b \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{\frac {3}{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} -\int -\left (a^2-\frac {b^2}{{\cos \left (c+d\,x\right )}^2}\right )\,\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________